	<a href="javascript://" class="btn_3 fr tac dingz" id="dz">我来顶嘴</a>
	<input type="text" class="reply_input" name="comment" />
	<input type="hidden"  name="post_id" value="{$smarty.get.post_id}"/>
	{foreach $data as $val}
	<div class="sub_ups">
		<h3>{nl2br($val.content)}</h3>
		<p>#{$val.id} {date('m/d/Y  g:ia', $val.add_time)}</p>
	</div>
	{/foreach}
	<p class="page_con xsmall comment_pager">
	{if $pager->getPages() > 1}
		[ 翻页至: 
		{foreach $pager->getPagesArray(10) as $val}
		  {if $pager->getPage() == $val}
		    <a class="pgCurrent">{$val}</a>
		  {else}
		  <a href="{$pager->link($val)}">{$val}</a>
		  {/if}
		{/foreach}
		{if $pager->end() > 10 && $pager->end() != $pager->getPage()}
		 ..... 
		<a href="{$pager->link($pager->end())}">{$pager->end()}</a> 
		{/if}
		&nbsp; &nbsp; 共{$pager->getTotal()}条评论
		] 
	{/if}
	</p>
	<script type="text/javascript" charset="utf-8">
	
		$(".dingz").click(function(){
			var post_id = $("input[name=post_id]").val();
			var comment = $("input[name=comment]").val();
			var mess = $('cite', $(this).parents().prev()).children('a:eq(0)').children('span');
			if (!comment) {
				alert('请填写内容进行顶嘴');
				return false;
			};

			$.post('comment/create.html', { content: comment, post_id: post_id }, function(data){
				load_comment.call($('a[href='+post_id+']')[0]);
				
				if (data==0) {
					alert('顶嘴失败');
					return false;
				};
				if (data==2) {
					alert('您需要登录进行顶嘴');
					return false;
					
				};
				if (data==3) {
					alert('您发的内容不合法');
					return false;
					
				};
				if (data==88) {
					alert('超过10个字,注册后可以解除发言字数限制');
					return false;
					
				};
				if (data==100) {
					alert('没话说就别说了，旁边有按钮，可供发表观点。');
					return false;
					
				};
				
				mess.html(mess.html()-1+2);

				
			});
			$(this).unbind('click').html('loading...');
			return false;
		});

		$(".reply_input").keydown(function(event){
		  if(event.keyCode == 13) {
   	
			  	$(".dingz").click();
		  }
		
		  }); 

		


	</script>
